<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 在调用之前
      let menu = {
        width: 200,
        height: 300,
        title: "My menu",
      };
      function multiplyNumeric(obj) {
        for (let k in obj) {
          // 判断属性值是否是数字
          if (typeof obj[k] === "number") {
            obj[k] = obj[k] * 2;
          }
        }
      }
      multiplyNumeric(menu);
      console.log(menu);
    </script>
  </body>
</html>
